<!-- 导航切换组件 -->
<template name="contentSw">
	<view class="contentSw_con">
		<view :class="conIndex==index?'target':''" @click="conswitch(index)" v-for="(item,index) in swlist">{{item.name}}</view>
	</view>
</template>

<script>
	export default {
		name: "contentSw",
		data() {
			return {
				conIndex:0
			};
		},
		methods:{
			conswitch:function(index){
				this.conIndex = index;
				this.$emit('conswitch',{index:index});
			}
		},
		props: {
			swlist:''
		}
	}
</script>

<style lang="scss" scoped>
	.contentSw_con{
		padding: 30rpx 0;
		color: #666666;
		font-size: $uni-font-size-base;
		display: flex;
		justify-content: space-around;
		view{
			&.target{
				color: $uni-color-primary;
				font-weight: bold;
				position: relative;
				&:before{
					content: '';
					position: absolute;
					height: 7rpx;
					left: 0;
					right: 0;
					bottom: -30rpx;
					width: 40rpx;
					margin: 0 auto;
					background-color: $uni-color-primary;
				}
			}
		}
	}
</style>
